package cz.muni.pa036.hockeyStats;

/***********************************************************************
 * Module:  Role.java
 * Author:  Rojko
 * Purpose: Defines the Class Role
 ***********************************************************************/

/** @pdOid 73e54113-65dd-45d9-9299-b9a8f7d6ea38 */
public class Role {
   /** @pdOid 6084e7c0-68b9-4ab3-a726-8ecb63d00c4b */
   public int idRole;
   /** @pdOid ed8d28cf-cfbe-429f-b391-2c00c53af678 */
   public java.lang.String roleName;
   
   /** @pdRoleInfo migr=no name=Person assc=relationship19 coll=java.util.Collection impl=java.util.HashSet mult=0..* */
   public java.util.Collection<Person> person;
   
   
   /** @pdGenerated default getter */
   public java.util.Collection<Person> getPerson() {
      if (person == null)
         person = new java.util.HashSet<Person>();
      return person;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorPerson() {
      if (person == null)
         person = new java.util.HashSet<Person>();
      return person.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newPerson */
   public void setPerson(java.util.Collection<Person> newPerson) {
      removeAllPerson();
      for (java.util.Iterator iter = newPerson.iterator(); iter.hasNext();)
         addPerson((Person)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newPerson */
   public void addPerson(Person newPerson) {
      if (newPerson == null)
         return;
      if (this.person == null)
         this.person = new java.util.HashSet<Person>();
      if (!this.person.contains(newPerson))
         this.person.add(newPerson);
   }
   
   /** @pdGenerated default remove
     * @param oldPerson */
   public void removePerson(Person oldPerson) {
      if (oldPerson == null)
         return;
      if (this.person != null)
         if (this.person.contains(oldPerson))
            this.person.remove(oldPerson);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllPerson() {
      if (person != null)
         person.clear();
   }

}